package com.cunshe.service;

import com.cunshe.dao.OfficeDao;
import com.cunshe.domain.Office;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 办事处
 */
@Service
public class OfficeService {

    @Autowired
    private OfficeDao officeDao;

    @Transactional(rollbackFor = Exception.class)
    public int insert(Office record) {
        return officeDao.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    public int delete(Long id) {
        return officeDao.delete(id);
    }

    @Transactional(rollbackFor = Exception.class)
    public int update(Office record) {
        return officeDao.update(record);
    }

    public List<Office> list() {
        return officeDao.list();
    }

}